/* 滚动条 */
.scroll-container {
    &::-webkit-scrollbar {
        width: 4px;
    }

    &::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    &::-webkit-scrollbar-thumb {
        background: #e5e5e5;
        border-radius: 4px;
    }

    &::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
}
// 这个颜色好看#64748b
// #64748b
html {
    --ct-border-color: #e5e7eb;
    //--ct-left-bg-color : #f7faff;
    --ct-left-bg-color : #ffffff;
    // 主要字体颜色
    --text-color-primary: #0d6efd;
    // // #080808
    --text-color-black1: #080808;
    // 灰色字体颜色
    --text-color-grey: #64748b;
    --ct-navbg-color: #f7f7f7;
    // 背景颜色
    --bg-color: #fff;
    // 主要背景颜色
    --bg-color-hover: radial-gradient(circle at left,#409eff26 0,#fff 100%);
    // 灰白背景颜色
    --bg-color-pale: #f5f5f5;
    // markdown
    --markdown-bg-color1: #f4f6f8;
    --markdown-bg-color2: #bae0ff;
    &.dark {
        --color-fg-default: var(--el-text-color-primary);
        --ct-border-color: var(--ba-border-color);
        --ct-left-bg-color : var(--el-bg-color);
        --color-primary: var(--el-color-primary);
        --text-color-grey: var(--el-text-color-primary);
        --bg-color: var(--el-bg-color);
        --bg-color-hover: var(--el-bg-color);
        --bg-color-pale: var(--el-border-color-extra-light);
        --markdown-bg-color1: var(--el-border-color-extra-light);
        --markdown-bg-color2: var(--el-border-color-extra-light);
        --ct-navbg-color: var(--el-bg-color);
        --text-color-black1: var(--el-text-color-primary);
    }
}
a {
    text-decoration: none;
}
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
}
.max-auto {
    max-width: 1536px;
    margin: auto;
}
.chat-main {
    display: flex;
    flex-direction: row;
    height: 100%;
    background-color: var(--el-bg-color);
    .chat-list-body {
        position: relative;
        max-width: 400px;
        //min-width: 256px;
        .chat-list-box {
            display: flex;
            flex-direction: column;
            width: 100%;
            max-height: 100vh;
            height: 100vh;
            border-right: 1px solid var(--ct-border-color);
            overflow: hidden;
            .chat-list-header {
                display: flex;
                flex-direction: column;
                padding: 16px;
                gap: 16px;
                .chat-list-header-top {
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    height: 36px;
                    .title {
                        font-weight: 800;
                        font-size: 26px;
                    }
                    .button {
                        display: flex;
                        align-items: center;
                        justify-content: center;


                        height: 36px;
                        width: 36px;
                        color: #999999;
                        border-radius: 5px;
                        cursor: pointer;
                        &:hover {
                            color: #080808;
                            background-color: rgba(0, 0, 0, 0.06);
                        }
                    }
                }
                .chat-list-header-input {
                    position: relative;
                    .search {
                        height: 36px;
                        .el-input__wrapper {
                            &:hover {
                                background-color: rgba(0, 0, 0, 0.03);
                            }
                        }
                        .search-ico {
                            margin-right: 4px;
                        }
                    }
                    .tag {
                        position: absolute;
                        top: 50%;
                        right: 0;
                        transform: translateY(-50%);
                    }
                }
            }
            .chat-list-message {
                flex: 1;
                max-height: 100%;
                overflow: auto;
                padding: 8px 8px 0;
                &::-webkit-scrollbar {
                    width: 0;
                }
                .list-item {
                    padding: 12px 16px 12px 8px;
                    cursor: pointer;
                    border-radius: 5px;
                    &.active ,&:hover {
                        background-color: var(--bg-color-pale);
                    }
                    .item-box {
                        display: flex;
                        align-items: center;
                        gap: 8px;
                        width: 100%;
                        height: 46px;
                        .centre {
                            display: flex;
                            flex-direction: column;
                            flex: 1;
                            gap: 8px;
                            width: 100%;
                            .title {
                                font-size: 16px;
                                line-height: 1;
                                color: #080808;
                            }
                            .content {
                                font-size: 12px;
                                line-height: 1;
                                color: #999999;
                                max-width: 185px;
                                overflow: hidden;
                                white-space: nowrap;
                                text-overflow: ellipsis;
                            }
                        }
                        .right {
                            position: relative;
                            height: 100%;
                            min-width: 28px;
                            overflow: hidden;
                            .d1 {
                                font-size: 12px;
                                color: #bbbbbb;
                            }
                            .d2 {
                                display: none;
                                align-items: center;
                                justify-content: center;
                                position: absolute;
                                top: 10px;
                                border-radius: 5px;
                                height: 28px;
                                width: 28px;
                                cursor: pointer;
                                transform: rotate(90deg);
                                &:hover {
                                    color: #080808;
                                    background-color: rgba(0, 0, 0, 0.12);
                                }
                            }
                        }
                    }
                    &:hover {
                        .right {
                            .d1 {
                                display: none;
                            }
                            .d2 {
                                display: flex;
                            }
                        }
                    }
                }
            }
        }
        .layout-toggle {
            position: absolute;
            right: -15px;
            height: 100%;
            width: 16px;
            z-index: 1;
            .layout-toggle-button {
                display: none;
                position: absolute;
                cursor: pointer;
                top: 50%;
                width: 16px;
                height: 40px;
                border-radius: 0 4px 4px 0;
                border: 1px solid #e3e3e3;
                color: #080808;
                background: rgba(240, 240, 240, 1);
                justify-content: center;
                align-items: center;
                z-index: 1;
                &:hover {
                    color: #080808;
                    background: rgba(0, 0, 0, 0.12);
                }
            }
            &:hover {
                .layout-toggle-button {
                    display: flex;
                }
            }
        }
        .drag {
            position: absolute;
            right: -8px;
            width: 10px;
            height: 100%;
            cursor: col-resize;
            &:hover {
                &::before {
                    content: '';
                    position: absolute;
                    z-index: 50;
                    background: #222222;
                    width: 2px;
                    height: 100%;
                    //transition: all 0.2s cubic-bezier(0.215, 0.61, 0.355, 1);
                }
            }
        }
        &:hover {
            .layout-toggle-button {
                display: flex;
            }
        }
    }
    .chat-body {
        display: flex;
        flex-direction: column;
        flex: 1;
        background-color: #f8f8f8;
        .chat-header {
            display: flex;
            align-items: center;
            position: relative;
            padding: 0 16px;
            height: 64px;
            border-bottom: 1px solid var(--ct-border-color);
            .top {
                display: flex;
                align-items: center;
                width: 100%;
                height: 40px;
                .left-menu {
                    display: none;
                }
                .title {
                    display: flex;
                    align-items: center;
                    gap: 12px;
                    font-size: 16px;
                    color: var(-el-text-color-black);
                    .avatar {
                        cursor: pointer;
                    }
                    .info {
                        display: flex;
                        flex-direction: column;
                        gap: 4px;
                        .name {
                            display: flex;
                            align-items: center;
                            gap: 8px;
                            line-height: 1;
                            .nickname {
                                font-size: 14px;
                                font-weight: 700;
                            }
                            .ant-tag {
                                height: 20px;
                                cursor: pointer;
                            }
                        }
                        .desc {
                            height: 16px;
                            line-height: 1;
                            span {
                                font-size: 12px;
                                line-height: 1;
                                color: #999999;
                            }
                        }
                    }
                }
                .center {
                    flex: 1;
                }
                .right-menu {
                    display: flex;
                    align-items: center;
                    .nav-item {
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        width: 32px;
                        height: 32px;
                        margin-left: 8px;
                        cursor: pointer;
                        color: var(--text-color-grey);
                        font-size: 18px;
                        font-weight: 600;
                        border-radius: 5px;
                        border: 1px solid var(--ct-border-color);
                        &:hover {
                            background-color: #eef0f3;
                        }
                        &.active {
                            color: var(--text-color-primary);
                        }
                    }
                }
            }
        }
        .chat-content {
            position: relative;
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            .chat-message-body {
                flex: 1;
                overflow: auto;
                .chat-box-wrapper {
                    display: flex;
                    flex-direction: column;
                    align-items: center;
                    justify-content: center;
                    height: 80%;
                    color: var(--el-color);
                    h1 {
                        font-weight: 700;
                        font-size: 30px;
                        line-height: 1.2;
                        text-align: center;
                        padding: 8px 16px;
                        margin-bottom: 24px;
                    }
                    .content {
                        display: grid;
                        row-gap: 0.5rem;
                        column-gap: 0.5rem;
                        grid-template-columns: repeat(3,minmax(0,1fr));
                        .title {
                            display: flex;
                            align-items: center;
                            justify-content: center;
                            font-size: 16px;
                            padding: 16px;
                            text-align: center;
                            span {
                                margin-left: 8px;
                            }
                        }
                        .text {
                            display: flex;
                            align-items: center;
                            justify-content: center;
                            cursor: pointer;
                            min-width: 200px;
                            padding: 16px;
                            background-color: var(--bg-color-pale);
                            margin-bottom: 10px;
                        }
                    }
                }
                .chat-message {
                    max-width: 100%;
                    // chat-user chat-assistant chat-line chat-box
                    padding: 16px 16px 40px;
                    // 超出隐藏
                    overflow: hidden;
                    .message {
                        .chat-assistant {
                            display: flex;
                            margin-top: 20px;
                            .avatar {
                                margin-right: 10px;
                            }
                        }
                        .chat-user {
                            display: flex;
                            justify-content: flex-start;
                            flex-direction: row-reverse;
                            margin-top: 20px;
                            .avatar {
                                margin-left: 10px;
                            }
                            .markdown-body {
                                background-color: var(--markdown-bg-color2);
                            }
                        }
                        .markdown-body {
                            max-width: 80%;
                            background-color: var(--bg-color);
                            padding: 10px;
                            border-radius: 5px;
                            font-size: 14px;
                            .message-file {
                                display: flex;
                                align-items: center;
                                gap: 5px;
                                .image {
                                    width: 128px;
                                    height: 128px;
                                    border-radius: 5px;
                                }
                            }
                        }
                    }
                }
            }
        }
        .chat-footer {
            height: 30px;
            line-height: 30px;
            text-align: center;
        }
    }
}
@media (max-width: 768px) {
    .chat-main {
        .chat-list-body {
            display: none;
            height: 100%;
            position: absolute;
            background-color: var(--bg-color);
            z-index: 999;
            .layout-toggle {
                display: none;
            }
        }
        .is_menu_mini {
            display: block;
            z-index: 999;
        }
        .chat-footer {
            display: none;
        }
        .chat-body {
            //background: radial-gradient(circle at 12% 55%,rgba(33,150,243,.15),hsla(0,0%,100%,0) 25%),radial-gradient(circle at 85% 33%,rgba(108,99,255,.175),hsla(0,0%,100%,0) 25%);
            .chat-header {
                position: relative;
                border-bottom: none;
                height: 64px;
                padding: 0 8px;
                .top {
                    gap: 10px;
                    .left-menu {
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        //color: #fff;
                    }
                    .center {
                        display: none;
                    }

                    .title {
                        flex: 1;
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        .avatar {
                            display: none;
                        }
                        .info {
                            .name {
                                display: flex;
                                align-items: center;
                                justify-content: center;
                            }
                            .tag-list {
                                display: none;
                            }
                            .desc {
                                display: flex;
                                justify-content: center;
                            }
                        }
                    }
                    .right-menu {
                        .nav-item {
                            border: none;
                        }
                    }
                }
            }
            .chat-content {
                .chat-message-body {
                    margin-bottom: 0;
                    .chat-box-wrapper {
                        .content {
                            .title {
                                padding: 4px;
                                margin-bottom: 10px;
                            }
                            .text {
                                min-width: 0;
                                padding: 15px 10px;
                            }
                        }
                    }
                }
                .chat-message {
                    // chat-user chat-assistant chat-line chat-box
                    padding: 15px 10px!important;
                    .message {
                        .avatar {
                            width: 38px!important;
                            height: 38px!important;
                            margin-right: 5px!important;
                        }
                        .markdown-body {
                            max-width: 280px!important;
                        }
                    }
                }
            }
        }
    }
}
html.dark {
    .chat-list-body {
        .chat-list-box {
            .item-box {
                .centre {
                    .title {
                        color: #fff !important;
                    }
                }
            }
        }
    }
    .chat-body {
        background-color: #1d1e1f;
    }
}
